import React from 'react'
import { useLocation } from 'react-router-dom'

function Index() {
  //接收参数
  let location =useLocation()
  console.log(location)
  let detailData=location.state
  console.log(detailData)
  return (
    <div>
       <dl>
        <dt>
          <img src={detailData.url} alt="" style={{width:'100%',height:'200px'}}/>
        </dt>
        <dd>
           <h2>名称:{detailData.name}</h2>
            <h2>描述:{detailData.title}</h2>
             <h2>价格:￥{detailData.price}</h2>
        </dd>
       </dl>
    </div>
  )
}

export default Index
